package gmail.structure;

import java.util.ArrayList;

/**
 * Data structure to store a gmail thread
 * they contains information for summary of a message
 * detail content needed to be retrive by conversation
 * @version 0.3
 */
public class GMThread {

  /**
   * Gets or sets the thread identifier.
   */
  private String threadID;

  /**
   * Gets or sets the 'thread is read' flag.
   */
  private boolean read;

  /**
   * Gets or sets the 'thread is starred' flag.
   */
  private boolean starred;

  /**
   * Gets or sets the HTML-formatted thread date.
   */
  private String dateHtml;

  /**
   * Gets or sets the HTML-formatted thread author(s) text.
   */
  private String authorsHtml;

  /**
   * Gets or sets the flags String (unknown).
   */
  private String flags;

  /**
   * Gets or sets the thread subject.
   */
  private String subjectHtml;

  /**
   * Gets or sets the thread snippet.
   */
  private String snippetHtml;

  /**
   * Gets or sets a list of zero or more categories in which the thread is classified.
   */
  private ArrayList categories;

  /**
   * Gets or sets the HTML-formatted 'thread has attachment' text (contains an IMG tag).
   */
  private String attachHtml;

  /**
   * Gets or sets the thread-message link identifier.
   */
  private String matchingMessageID;

  public GMThread(){
    threadID = "";
    read = false;
    starred = false;
    dateHtml = "";
    authorsHtml = "";
    flags = "";
    subjectHtml = "";
    snippetHtml = "";
    categories = new ArrayList();
    attachHtml = "";
    matchingMessageID = "";
  }

  public String getAttachHtml() {
    return attachHtml;
  }
  public String getAuthorsHtml() {
    return authorsHtml;
  }
  public ArrayList getCategories() {
    return categories;
  }
  public String getDateHtml() {
    return dateHtml;
  }
  public String getFlags() {
    return flags;
  }
  public String getMatchingMessageID() {
    return matchingMessageID;
  }
  public boolean isRead() {
    return read;
  }
  public String getSnippetHtml() {
    return snippetHtml;
  }
  public boolean isStarred() {
    return starred;
  }
  public String getSubjectHtml() {
    return subjectHtml;
  }
  public String getThreadID() {
    return threadID;
  }
  public void setThreadID(String threadID) {
    this.threadID = threadID;
  }
  public void setSubjectHtml(String subjectHtml) {
    this.subjectHtml = subjectHtml;
  }
  public void setStarred(boolean starred) {
    this.starred = starred;
  }
  public void setSnippetHtml(String snippetHtml) {
    this.snippetHtml = snippetHtml;
  }
  public void setRead(boolean read) {
    this.read = read;
  }
  public void setMatchingMessageID(String matchingMessageID) {
    this.matchingMessageID = matchingMessageID;
  }
  public void setFlags(String flags) {
    this.flags = flags;
  }
  public void setDateHtml(String dateHtml) {
    this.dateHtml = dateHtml;
  }
  public void setCategories(ArrayList categories) {
    this.categories = categories;
  }
  public void setAuthorsHtml(String authorsHtml) {
    this.authorsHtml = authorsHtml;
  }
  public void setAttachHtml(String attachHtml) {
    this.attachHtml = attachHtml;
  }

  public String toString(){
    StringBuffer buf = new StringBuffer();
    buf.append("[ ThreadID: " + this.getThreadID() + "\n");
    buf.append("Read: " + this.isRead() + "\n");
    buf.append("Starred: " + this.isStarred() + "\n");
    buf.append("DateHtml: " + this.getDateHtml() + "\n");
    buf.append("AuthorsHtml: " + this.getAuthorsHtml() + "\n");
    buf.append("Flags: " + this.getFlags() + "\n");
    buf.append("SubjectHtml: " + this.getSubjectHtml() + "\n");
    buf.append("SnippetHtml: " + this.getSnippetHtml() + "\n");
    buf.append("Categories: " + this.getCategories() + "\n");
    buf.append("AuthorsHtml: " + this.getAuthorsHtml() + "\n");
    buf.append("AttachHtml: " + this.getAttachHtml() + "] ");
    return buf.toString();
  }

}

